<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
	<title>交易记录</title>
	<link rel="stylesheet" href="../css/record.css" />
	<script src="../js/jquery-1.10.2.min.js"></script>
</head>
<script>
function show(id){
	document.getElementById(id).style.display = 'block';
}
function hin(id){
	document.getElementById(id).style.display = 'none';
}
</script>
<body>
	<div class="wrap">
		<div class="logo">
		<!--头部-->
			<a href=""><img src="../images/dota2_logn.png" alt="恋尚优饰品交易中心"></a>
		<div class="login">
						<div class="user">
							<div class="user_img">
								<img src="../images/user.png" alt="" />
							</div>
							<div class="user_name" onmouseover="$('#user_name_none').css('display', 'block');"
								onmouseout="$('#user_name_none').css('display', 'none');">
								<a href="" id="user_name_a">
									<span>${userInfo. uName}</span> <b class="caret"></b>
								</a>
								<ul id="user_name_none">
									<li class="user_home"><a
										href="/index.php/home/User/my.html">个人主页</a></li>
									<li class="out_login"><a href="javascript:void(0)"
										id="quit"   onclick="loginOut()">退出登录</a></li>
								</ul>
							</div>
						</div>
			<!-- end -->
			</div>
		</div>
		<!--头部end-->
		<div class="bodyer">
			<div class="container">
			<!--主体内容-->
				<div class="site">
				<!-- 位置 -->
					<div class="home_icon">
						<a href="/index.php/home/Index/index.html"><img src="../images/home_icon.png" alt="" /></a>
					</div>
					<div class="triangle"></div>
					<div class="site_sp">
						<a href="/index.php/home/User/my.html">用户中心</a>
					</div>
					<div class="triangle1"></div>
					<div class="site_ss">
						交易记录
					</div>
				<!-- 位置end -->
				</div>
				<div class="container1">
					<div class="ample_container">
					<!-- 左边内容 -->
						<div class="ample_container_top">
							<ul>
								<li class="ample_container_top1"><a href="javascript:void(0)">我的购买</a></li>
							</ul>
						</div>
						<div class="form_group">
						<!-- 交易记录内容	 -->
							<div class="record">
							
							</div>
							<div class="record_content">
								<div class="record_content_title">
									<div class="record_content_title1">饰品</div>
									<div class="record_content_title2">单价（元）</div>
									<div class="record_content_title3">数量（件）</div>
									<div class="record_content_title4">
										<div class="record_content_title5">状态</div>
										<div class="record_content_title6" id="record_click" tabindex="0" style="-moz-user-select:none;">
											<span class="record_content_span">全部</span>
											<div class="record_content_span1">
												<span></span>
											</div>
										</div>
										<div class="record_select" id="record_select_none" tabindex="0">
											<a href="javascript:void(0)"><div class="record_select_div" name="1">全部</div></a>
											<div class="border_bottom"></div>
											<a href="javascript:void(0)"><div class="record_select_div" name="4">已发货</div></a>
											<div class="border_bottom"></div>
											<a href="javascript:void(0)"><div class="record_select_div" name="2">等待付款</div></a>
											<div class="border_bottom"></div>
											<a href="javascript:void(0)"><div class="record_select_div" name="3">交易成功</div></a>
										</div>
									</div>
								</div>
							</div>
							<div class="page_content">
							<c:forEach items="${orderList }" var="info">
							
							
									<div class="record_be">
									<div class="record_state">
										<div class="record_state_num">
											订单编号：${info.oId }
										</div>
										<div class="record_state_time">
											交易时间：${info.oCreateTime }
										</div>
									</div>
									
									 <c:forEach items="${info.records }" var="record">
									
									<div class="record_goods_left">
									<div class="record_goods_back">
										<div class="record_goods_img" name="">
											<img src="${record.rImage }" alt="" width="79" height="52" />
										</div>
										<%-- <div class="record_goods_name">
											${record.rParamDataString }
										</div> --%>
									</div>
									<div class="record_goods_price">
										${record.rMoney /100}
									</div>
									<div class="record_goods_num">
										${record.rNumber }
									</div>
									</div>
									<div class="record_goods_right">
									 <div class="record_goods_all">
										${record.rMoney /100*record.rNumber}
									</div>
									<div class="record_goods_state">
										<c:if test="${info.oStatus==0 }">
										     未发货
										</c:if>	
										<c:if test="${info.oStatus!=0 }">
										     已发货
										</c:if>															
										</div>
									</div>
									</c:forEach> 
									
								</div>
							</c:forEach>				
														
								<div class="showpage">
									<div>    </div>
								</div>
							</div>
						<!-- 交易记录内容end -->
						</div>
					<!-- 左边内容end -->
					</div>
					<div class="user_info">
					<!-- 右边内容 -->
						<div class="user_info_img">
							<img src="../images/user.png" alt="" />
						</div>
						<div class="user_info_name">
							<p>${userInfo. uName}</p>
						</div>
						<div class="user_info_site">
							<p>
								<span class="user_info_site1">
									<img src="../images/dw.png" alt="" />
									湖南省衡阳市 电信</span>
								<span class="user_info_site2">
									<img src="../images/time.png" alt="" />
									1小时前
								</span>
							</p>
						</div>
						<div class="ample_user_bor"></div>
						<div class="user_info_sign">
							<p>你若情深我必意重，唯有不负好时光。</p>
							
						</div>
						<div class="ample_user_bor"></div>
					<!-- 右边内容end -->
					</div>
					<div class="nav_bar">
					<!-- 右边导航栏 -->
						<a href="/index.php/home/Record/index.html">
							<div class="nav_bar_1 ">
								<img src="../images/repertory.png" alt="" />
								<span>交易记录</span>
						</div>
						</a>
				
						<a href="../front/setting">
							<div class="nav_bar_1">
								<img src="../images/set.png" alt="" />
								<span>个人设置</span>
							</div>
						</a>
					<!-- 右边导航栏end -->
					</div>
				</div>
			<!--主题内容end-->
			</div>
			<!-- boyder end -->
		</div>
		<div class="footer">
			<div class="footer_container">
				<p>
					<a href="/index.php/home/Index/index.html">首页</a><b>|</b>
					<a href="#">关于我们</a><b>|</b>
					<a href="#">意见反馈</a><b>|</b>
					<a href="#">商务合作</a>
				</p>
			</div>
		</div>
	</div>
</body>
</html>
<script>
	window.onload = function(){
	var record = document.getElementById("record_click");
	var select = document.getElementById("record_select_none");
	var flag = false;
	record.onclick = function(){
		if(flag){
			select.style.display="none";
			flag=false;
		}
		else{
			select.style.display="block";
			select.onclick = function(){
				select.style.display="none";
				flag=false;
			}
			flag=true;
		}
	}
}

	$("#login_out").click(function(){
		// alert(1);
		$.ajax({
			url:"/index.php/home/Index/quit",
            success:function(data){
            	if(data == 1){
            		window.location.href="/index.php/home/Index/index.html";
            	}
            }
		})
	})

	$(function(){
		$(".showpage a").live('click',function(){
			var pageobj = this;
			var url = pageobj.href;
			$.ajax({
				dataType:"JSON",
				type:"get",
				url:url,
				success:function(data){
					$(".page_content").html(data);
				}
			})
			return false;
		})
		$(".record_select_div").click(function(){
			var id = $(this).attr("name");
			// console.log(id);

			$.ajax({
				url:"/index.php/home/Record/index.html",
				type:"get",
				data:{
					sort:id,
				},
				success:function(data){
					$(".page_content").html(data);
				}
			})
		})
	})
	
</script>
